function[trainingSet, testSet] = splitIntoTrainingAndTest(featureVecs, splitDefFilePath)
% Splits the given set of feature vectors into training and test set
% according to the definition in a file.
%
%   INPUT
%   featureVecs.........A set of feature vectors as returned by loadWines()
%                       for example.
%   splitDefFilePath....The path to a file containing a comma-separated
%                       list of feature vector indizes that shall be used
%                       as training set. The remaining feature vectors of
%                       the given set will becoe the test set.
%   OUTPUT
%   trainingSet.........The vectors of featureVecs specified in the file.
%   testSet.............The remaining vectors of featureVecs.

    file = fopen(splitDefFilePath);
    indizes = fscanf(file, '%u,');
    fclose(file);
    trainingSet = featureVecs(:, indizes);
    testSet = featureVecs;
    testSet(:, indizes) = [];
end
